(function() {
    'use strict';

    angular
        .module('milkbeeApp')
        .controller('RequisitionController', RequisitionController);

    RequisitionController.$inject = ['$scope', '$state', 'Requisition'];

    function RequisitionController ($scope, $state, Requisition) {
        var vm = this;

        vm.requisitions = [];

        loadAll();

        function loadAll() {
            Requisition.query(function(result) {
                vm.requisitions = result;
                vm.searchQuery = null;
            });
        }
    }
})();
